<template>
<!--    <h2>首页</h2>-->
    <div>
        <Position/>
        <div @click="SearchJump">
            <SearchCom/>
        </div>
    </div>
    <NavCom/>
    <!--    轮播图组件-->
    <DetailCom :merchants="merchants"/>
    <TabBar/>

</template>

<script>
    import Position from "../components/Position.vue";
    import SearchCom from "../components/SearchCom.vue";
    import NavCom from "../components/NavCom.vue";
    import DetailCom from "../components/DetailCom.vue";
    import TabBar from "../components/tabBar/TabBar.vue";
    import {computed} from "vue";

    export default {
        name: "HomeView",
        components: {Position, SearchCom, NavCom, DetailCom, TabBar},
        data() {
            return {
                merchants:computed(() => this.$store.state.merchants)
            }
        },
        methods: {
            SearchJump() {
                this.$router.push(`/search-view`)
            }
        },
        created() {
            this.$store.dispatch('getPosition')
            this.$store.dispatch('getNav')
            this.$store.dispatch('getMerchants')
        }
    }
</script>

<style scoped>
    footer {
        height: 50px
    }
</style>